import Vue from 'vue';
import App from './auth.vue';
import VueRouter from 'vue-router';
import Axios from './config/axios';
import { Toast,Dialog } from 'vant';
import './assets/auth.less'; 
import 'vant/lib/index.css'



Vue.prototype.Axios    = Axios;

const Login = resolve => {
    require.ensure(['touch/routers/auth/login.vue'], () => {
        resolve(require('touch/routers/auth/login.vue'))
    })
}

const Register = resolve => {
    require.ensure(['touch/routers/auth/register.vue'], () => {
        resolve(require('touch/routers/auth/register.vue'))
    })
}

const Password = resolve => {
    require.ensure(['touch/routers/auth/password.vue'], () => {
        resolve(require('touch/routers/auth/password.vue'))
    })
}

const router = new VueRouter({
	mode: 'hash',
    routes: [
       	{ path: '/', component: Login },
       	{ path: '/register', component: Register },
       	{ path: '/password', component: Password },
    ]
});

Vue.use(VueRouter);
Vue.use(Toast);
Vue.use(Dialog);

new Vue({
    el: '#app',
    router: router,
    render: h => h(App)
});